/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.lm.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Robson Motta
 */
@Embeddable
public class CtrlPerfilAcessoPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_perfil")
    private int idPerfil;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_modulo_root")
    private int idModuloRoot;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_modulo_item")
    private int idModuloItem;

    public CtrlPerfilAcessoPK() {
    }

    public CtrlPerfilAcessoPK(int idPerfil, int idModuloRoot, int idModuloItem) {
        this.idPerfil = idPerfil;
        this.idModuloRoot = idModuloRoot;
        this.idModuloItem = idModuloItem;
    }

    public int getIdPerfil() {
        return idPerfil;
    }

    public void setIdPerfil(int idPerfil) {
        this.idPerfil = idPerfil;
    }

    public int getIdModuloRoot() {
        return idModuloRoot;
    }

    public void setIdModuloRoot(int idModuloRoot) {
        this.idModuloRoot = idModuloRoot;
    }

    public int getIdModuloItem() {
        return idModuloItem;
    }

    public void setIdModuloItem(int idModuloItem) {
        this.idModuloItem = idModuloItem;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idPerfil;
        hash += (int) idModuloRoot;
        hash += (int) idModuloItem;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CtrlPerfilAcessoPK)) {
            return false;
        }
        CtrlPerfilAcessoPK other = (CtrlPerfilAcessoPK) object;
        if (this.idPerfil != other.idPerfil) {
            return false;
        }
        if (this.idModuloRoot != other.idModuloRoot) {
            return false;
        }
        if (this.idModuloItem != other.idModuloItem) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.lm.entity.CtrlPerfilAcessoPK[ idPerfil=" + idPerfil + ", idModuloRoot=" + idModuloRoot + ", idModuloItem=" + idModuloItem + " ]";
    }
    
}
